Skip to contentSkip to conversation

Xen timing mode

DISCUSSION PBhat 3 participants 8 messages Feb 23, 2010

lore
Share & tools
lore

PBhat

author
#0 lore raw

A question about timing modes in Xen came up after reading the documentation on
http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=(interrupts)|(timer)
configuration file options and I was wondering if you could help me with it.

* I know that Xen has a facility on the user domains to change the
timing from something called the ' http://openskill.info/infobox.php?ID=1451
independent wallclock ' to 'dependent clock' and vice versa. The way to do this is to toggle the parameter /proc/sys/xen/independent_wallclock between 0 (dependent) and 1 (independent)

* Now, the documentation on the configuration options for xen virtual
machine under the heading of Timers contains no mention of the above mentioned facility, but instead talks about something called a 'timer_mode'

timer_mode: Timer mode (0=delay virtual time when ticks are missed;
1=virtual time is always wallclock time
timer_mode (default=1; Value='TIMER_MODE')

Now my question is whether the timer mode = 1 is equivalent to independent_ wallclock?

I think the answer is no. While timer_mode = 1 decides whether the virtual machine is able to read the Domain-0 time, the independent_wallclock decides whether you need NTP sychronization on both (user and control) domains or not.

Namely, in the timer_mode = 1, the gettimeofday() called from the virtual machine will return the domain virtual time, but time_mode = 0 gettimeofday() instruction from the virtual machine will return the system time.

The independent and dependent modes have an effect on whether the virtual machines can use the NTP or any other synchronization of Domain-0.

Is my understanding correct?

I further want to know whether the working remains similar on Xen HVMs also. In the sense that are Hardware based virtual machines capable of reading the Domain-0 system time in an analogous way?

Your help would be much appreciated. I am new to this area and I apologize if my questions seem too basic.

Signature · 2 lines
View this message in context: http://old.nabble.com/Xen-timing-mode-tp27706447p27706447.html
Sent from the Xen - Dev mailing list archive at Nabble.com.
#1 lore raw

Independent_wallclock is specific to Linux PV guests, and is set within the guest. Timer_mode is specific to HVM guests and is a domain build-time config option.

-- Keir

Quoted 49 lines · PBhat

A question about timing modes in Xen came up after reading the documentation on
http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=(inter
rupts)|(timer)
configuration file options and I was wondering if you could help me with it.

* I know that Xen has a facility on the user domains to change the
timing from something called the ' http://openskill.info/infobox.php?ID=1451
independent wallclock ' to 'dependent clock' and vice versa. The way to do this is to toggle the parameter /proc/sys/xen/independent_wallclock between 0 (dependent) and 1 (independent)

* Now, the documentation on the configuration options for xen virtual
machine under the heading of Timers contains no mention of the above mentioned facility, but instead talks about something called a 'timer_mode'

timer_mode: Timer mode (0=delay virtual time when ticks are missed;
1=virtual time is always wallclock time
timer_mode (default=1; Value='TIMER_MODE')

Now my question is whether the timer mode = 1 is equivalent to independent_ wallclock?

I think the answer is no. While timer_mode = 1 decides whether the virtual machine is able to read the Domain-0 time, the independent_wallclock decides whether you need NTP sychronization on both (user and control) domains or not.

Namely, in the timer_mode = 1, the gettimeofday() called from the virtual machine will return the domain virtual time, but time_mode = 0 gettimeofday() instruction from the virtual machine will return the system time.

The independent and dependent modes have an effect on whether the virtual machines can use the NTP or any other synchronization of Domain-0.

Is my understanding correct?

I further want to know whether the working remains similar on Xen HVMs also. In the sense that are Hardware based virtual machines capable of reading the Domain-0 system time in an analogous way?

Your help would be much appreciated. I am new to this area and I apologize if my questions seem too basic.

author
#2 lore raw

Thanks !

In that case, how does a para-virtualized user domain find the domain - virtual time ?

--Priya

Quoted 61 lines · Keir Fraser

Independent_wallclock is specific to Linux PV guests, and is set within the guest. Timer_mode is specific to HVM guests and is a domain build-time config option.

-- Keir

Quoted 2 lines · PBhat

A question about timing modes in Xen came up after reading the

documentation

Quoted 2 lines

on

http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=(inter<http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=%28inter>

Quoted 6 lines

rupts)|(timer)
configuration file options and I was wondering if you could help me with it.

* I know that Xen has a facility on the user domains to change the
timing from something called the '

http://openskill.info/infobox.php?ID=1451

Quoted 1 line

independent wallclock ' to 'dependent clock' and vice versa. The way to

do

Quoted 1 line

this is to toggle the parameter /proc/sys/xen/independent_wallclock

between

Quoted 6 lines

0 (dependent) and 1 (independent)

* Now, the documentation on the configuration options for xen virtual
machine under the heading of Timers contains no mention of the above mentioned facility, but instead talks about something called a

'timer_mode'

Quoted 7 lines

timer_mode: Timer mode (0=delay virtual time when ticks are missed;
1=virtual time is always wallclock time
timer_mode (default=1; Value='TIMER_MODE')

Now my question is whether the timer mode = 1 is equivalent to

independent_

Quoted 3 lines

wallclock?

I think the answer is no. While timer_mode = 1 decides whether the

virtual

Quoted 1 line

machine is able to read the Domain-0 time, the independent_wallclock

decides

Quoted 6 lines

whether you need NTP sychronization on both (user and control) domains or not.

Namely, in the timer_mode = 1, the gettimeofday() called from the virtual machine will return the domain virtual time, but time_mode = 0 gettimeofday() instruction from the virtual machine will return the

system

Quoted 8 lines

time.

The independent and dependent modes have an effect on whether the virtual machines can use the NTP or any other synchronization of Domain-0.

Is my understanding correct?

I further want to know whether the working remains similar on Xen HVMs

Quoted 13 lines

also.

Quoted 1 line

In the sense that are Hardware based virtual machines capable of reading

the

Quoted 4 lines

Domain-0 system time in an analogous way?

Your help would be much appreciated. I am new to this area and I

apologize

Quoted 1 line

if my questions seem too basic.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

What do you mean by domain - virtual time?

Quoted 74 lines · Priya

Thanks !

In that case, how does a para-virtualized user domain find the domain - virtual time ?

--Priya

Quoted 63 lines · Keir Fraser

Independent_wallclock is specific to Linux PV guests, and is set within the guest. Timer_mode is specific to HVM guests and is a domain build-time config option.

 -- Keir

Quoted 52 lines · PBhat

A question about timing modes in Xen came up after reading the documentation on
http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=(int
er
<http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=%28
inter>
rupts)|(timer)
configuration file options  and I was wondering if you could help me with it.

    * I know that Xen has a facility on the user domains to change the timing from something called the ' http://openskill.info/infobox.php?ID=1451
independent wallclock ' to 'dependent clock' and vice versa. The way to do this is to toggle the parameter /proc/sys/xen/independent_wallclock between 0 (dependent) and 1 (independent)

    * Now, the documentation on the configuration options for xen virtual machine under the heading of Timers contains no mention of the above mentioned facility, but instead talks about something called a 'timer_mode'

 timer_mode: Timer mode (0=delay virtual time when ticks are missed; 1=virtual time is always wallclock time
      timer_mode (default=1; Value='TIMER_MODE')

Now my question is whether the timer mode  = 1 is equivalent to independent_ wallclock?

I think the answer is no. While timer_mode = 1 decides whether the virtual machine is able to read the Domain-0 time, the independent_wallclock decides whether you need NTP sychronization on both (user and control) domains or not.

Namely, in the timer_mode = 1, the gettimeofday() called from the virtual machine will return the domain virtual time, but time_mode = 0 gettimeofday() instruction from the virtual machine will return the system time.

The independent and dependent modes have an effect on whether the virtual machines can use the NTP or any other synchronization of Domain-0.

Is my understanding correct?

I further want to know whether the working remains similar on Xen HVMs also. In the sense that are Hardware based virtual machines capable of reading the Domain-0 system time in an analogous way?

Your help would be much appreciated. I am new to this area and I apologize if my questions seem too basic.

author
#4 lore raw

The Xen Interface manual for Xen v2.0 (attached) Page 4 defines Domain - virtual time as

" The time that progresses at the same pace as system time, but only while a domain is executing -- it stops while a domain is de-scheduled. Therefore the share of the CPU that a domain receives is indicated by the rate at which its virtual time increases."

I am interesting in finding out if any of the timing system calls/instructions like gettimeofday(), hwclock(), rdtsc() can read this domain virtual time.

Thanks, again !

PS: I could not find a similar documentation for Xen v3.0 or later

Quoted 86 lines · Keir Fraser

What do you mean by domain - virtual time?

Quoted 11 lines · Priya

Thanks !

In that case, how does a para-virtualized user domain find the domain - virtual time ?

--Priya

On Tue, Feb 23, 2010 at 12:08 PM, Keir Fraser <[email protected]

Quoted 1 line · wrote:

Independent_wallclock is specific to Linux PV guests, and is set within

the

Quoted 9 lines
Quoted 9 lines

guest. Timer_mode is specific to HVM guests and is a domain build-time config option.

-- Keir

Quoted 2 lines · PBhat

A question about timing modes in Xen came up after reading the

documentation

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

on

http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=(int<http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=%28int>

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

er
<

http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=%28

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

inter>
rupts)|(timer)
configuration file options and I was wondering if you could help me

with

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

it.

* I know that Xen has a facility on the user domains to change the
timing from something called the '

http://openskill.info/infobox.php?ID=1451

Quoted 1 line
Quoted 1 line
Quoted 1 line

independent wallclock ' to 'dependent clock' and vice versa. The way to

do

Quoted 1 line
Quoted 1 line
Quoted 1 line

this is to toggle the parameter /proc/sys/xen/independent_wallclock

between

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

0 (dependent) and 1 (independent)

* Now, the documentation on the configuration options for xen

virtual

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

machine under the heading of Timers contains no mention of the above mentioned facility, but instead talks about something called a

'timer_mode'

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

timer_mode: Timer mode (0=delay virtual time when ticks are missed;
1=virtual time is always wallclock time
timer_mode (default=1; Value='TIMER_MODE')

Now my question is whether the timer mode = 1 is equivalent to

independent_

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

wallclock?

I think the answer is no. While timer_mode = 1 decides whether the

virtual

Quoted 1 line
Quoted 1 line
Quoted 1 line

machine is able to read the Domain-0 time, the independent_wallclock

decides

Quoted 1 line
Quoted 1 line
Quoted 1 line

whether you need NTP sychronization on both (user and control) domains

or

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

not.

Namely, in the timer_mode = 1, the gettimeofday() called from the

virtual

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

machine will return the domain virtual time, but time_mode = 0 gettimeofday() instruction from the virtual machine will return the

system

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

time.

The independent and dependent modes have an effect on whether the

virtual

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

machines can use the NTP or any other synchronization of Domain-0.

Is my understanding correct?

I further want to know whether the working remains similar on Xen HVMs

Quoted 18 lines

also.

Quoted 1 line
Quoted 1 line
Quoted 1 line

In the sense that are Hardware based virtual machines capable of

reading the

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Domain-0 system time in an analogous way?

Your help would be much appreciated. I am new to this area and I

apologize

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

if my questions seem too basic.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

author
#5 lore raw

The latest interface manual which contains a similar definition of domain-virtual time as stated in my last email can be found here:

http://www.cl.cam.ac.uk/research/srg/netos/xen/readmes/interface/interface.html#SECTION00340000000000000000

Priya

Quoted 12 lines · Priya

The Xen Interface manual for Xen v2.0 (attached) Page 4 defines Domain - virtual time as

" The time that progresses at the same pace as system time, but only while a domain is executing -- it stops while a domain is de-scheduled. Therefore the share of the CPU that a domain receives is indicated by the rate at which its virtual time increases."

I am interesting in finding out if any of the timing system calls/instructions like gettimeofday(), hwclock(), rdtsc() can read this domain virtual time.

Quoted 113 lines

Thanks, again !

PS: I could not find a similar documentation for Xen v3.0 or later

Quoted 104 lines · Keir Fraser

What do you mean by domain - virtual time?

Quoted 8 lines · Priya

Thanks !

In that case, how does a para-virtualized user domain find the domain - virtual time ?

--Priya

On Tue, Feb 23, 2010 at 12:08 PM, Keir Fraser <

[email protected]>

Quoted 2 lines
Quoted 1 line · wrote:

Independent_wallclock is specific to Linux PV guests, and is set within

the

Quoted 9 lines
Quoted 9 lines

guest. Timer_mode is specific to HVM guests and is a domain build-time config option.

-- Keir

Quoted 2 lines · PBhat

A question about timing modes in Xen came up after reading the

documentation

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

on

http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=(int<http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=%28int>

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

er
<

http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions?highlight=%28

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

inter>
rupts)|(timer)
configuration file options and I was wondering if you could help me

with

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

it.

* I know that Xen has a facility on the user domains to change the
timing from something called the '

http://openskill.info/infobox.php?ID=1451

Quoted 1 line
Quoted 1 line
Quoted 1 line

independent wallclock ' to 'dependent clock' and vice versa. The way

to do

Quoted 1 line
Quoted 1 line
Quoted 1 line

this is to toggle the parameter /proc/sys/xen/independent_wallclock

between

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

0 (dependent) and 1 (independent)

* Now, the documentation on the configuration options for xen

virtual

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

machine under the heading of Timers contains no mention of the above mentioned facility, but instead talks about something called a

'timer_mode'

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

timer_mode: Timer mode (0=delay virtual time when ticks are missed;
1=virtual time is always wallclock time
timer_mode (default=1; Value='TIMER_MODE')

Now my question is whether the timer mode = 1 is equivalent to

independent_

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

wallclock?

I think the answer is no. While timer_mode = 1 decides whether the

virtual

Quoted 1 line
Quoted 1 line
Quoted 1 line

machine is able to read the Domain-0 time, the independent_wallclock

decides

Quoted 1 line
Quoted 1 line
Quoted 1 line

whether you need NTP sychronization on both (user and control) domains

or

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

not.

Namely, in the timer_mode = 1, the gettimeofday() called from the

virtual

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

machine will return the domain virtual time, but time_mode = 0 gettimeofday() instruction from the virtual machine will return the

system

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

time.

The independent and dependent modes have an effect on whether the

virtual

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

machines can use the NTP or any other synchronization of Domain-0.

Is my understanding correct?

I further want to know whether the working remains similar on Xen HVMs

also.

Quoted 1 line
Quoted 1 line
Quoted 1 line

In the sense that are Hardware based virtual machines capable of

reading the

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Domain-0 system time in an analogous way?

Your help would be much appreciated. I am new to this area and I

apologize

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

if my questions seem too basic.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#6 lore raw
In reply to Priya
Quoted 6 lines · Priya

The Xen Interface manual for Xen v2.0 (attached) Page 4 defines Domain
- virtual time as

" The time that progresses at the same pace as system time, but only while a domain is executing -- it stops while a domain is de-scheduled. Therefore the share of the CPU that a domain receives is indicated by the rate at which its virtual time increases."

I am interesting in finding out if any of the timing system calls/instructions like gettimeofday(), hwclock(), rdtsc() can read this domain virtual time.

/proc/stat publishes stolen time for each vcpu (second-last column on the "cpuX" lines); you can subtract that from monotonic time to work out how much vcpu the domain has got.

J

author
#7 lore raw

Thank you very much!

Quoted 20 lines · Jeremy Fitzhardinge
Quoted 12 lines · Priya

The Xen Interface manual for Xen v2.0 (attached) Page 4 defines Domain - virtual time as

" The time that progresses at the same pace as system time, but only while a domain is executing -- it stops while a domain is de-scheduled. Therefore the share of the CPU that a domain receives is indicated by the rate at which its virtual time increases."

I am interesting in finding out if any of the timing system calls/instructions like gettimeofday(), hwclock(), rdtsc() can read this domain virtual time.

/proc/stat publishes stolen time for each vcpu (second-last column on the "cpuX" lines); you can subtract that from monotonic time to work out how much vcpu the domain has got.

Quoted 8 lines

J

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel